import httpInstant from '../utils/http';



/**
 * @description 获取帖子是否被该用户收藏
 * @param  postId 帖子id
 * @param  userId 用户id
 * @returns
 */
export function getPostIsCollectionApi(postId, userId) {
  return httpInstant.get(`/collection/getPostIsCollection`, {
    params: {
      postId,
      userId
    }
  });
}


/**
 * @description 切换收藏状态
 * @param  postId 帖子id
 * @param  userId 用户id
 * @param  isGood 收藏状态
 * @returns
 */
export function switchCollectionApi(postId, userId, isGood) {

  return httpInstant.put(`/collection/switchCollection`, {

    postId,
    userId,
    is: isGood

  });
}


export function getCollectionListApi({
  userId,
  browseUserId,
  currentPage = 1,
  pageSize = 10
}) {
  return httpInstant.get(`/collection/getCollectionList`, {
    params: {
      userId,
      browseUserId,
      currentPage,
      pageSize
    }
  });
}